package cn.zqh.bean.bo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author zqh
 * @since 2022-12-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("Commodity")
@ApiModel(value="Commodity对象", description="")
public class Commodity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "商品主键")
    @TableId(value = "Commodity_id", type = IdType.ID_WORKER_STR)
    private String commodityId;

    @ApiModelProperty(value = "商品名字")
    @TableField("Commodity_name")
    private String commodityName;

    @ApiModelProperty(value = "商品图片")
    @TableField("Avatar")
    private String Avatar;

    @ApiModelProperty(value = "商品描述")
    @TableField("Intro")
    private String Intro;

    @ApiModelProperty(value = "所属店铺")
    @TableField("Store_id")
    private String storeId;

    @ApiModelProperty(value = "所属类型")
    @TableField("Style")
    private String style;

    @ApiModelProperty(value = "价格")
    @TableField("Price")
    private Double Price;

    @ApiModelProperty(value = "库存")
    @TableField("Number")
    private Integer Number;

    @ApiModelProperty(value = "销售量")
    @TableField("Sales_volume")
    private Integer salesVolume;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "逻辑删除")
    @TableField(value = "Is_delete",select = false)
    @TableLogic
    private Integer isDelete;

    @ApiModelProperty(value = "所属品牌")
    @TableField(value = "brand_id")
    private Integer brandId;


}
